using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RobotSimulator.Basic;

public class UIInputer : BasicInputer
{
   
    protected override void Start()
    {
        base.Start();
        Cursor.lockState = CursorLockMode.Locked;
       
    }
    public int lock_frame_count;
    private int count;
    protected override void Control()
    {
        if (count > lock_frame_count)
        {
            if (GameManager.instance.state == GameState.Usual)
            {
                if (key_values[0])
                {
                    Cursor.lockState = CursorLockMode.None;
                    Time.timeScale = 0;
                    GameManager.instance.state = GameState.Pause;
                    count = 0;


                }
            }
            else if (GameManager.instance.state == GameState.Pause)
            {
                if (key_values[0])
                {
                    Cursor.lockState = CursorLockMode.Locked;
                    Time.timeScale = 1;
                    GameManager.instance.state = GameState.Usual;
                    count = 0;

                }
            }
        }
        else
        {
            count++;
        }
        
    }
}
